/*
 * CommProtocol_Commands.h
 *
 *  Created on: Jan 21, 2014
 *      Author: ppks
 */

#ifndef COMMPROTOCOL_COMMANDS_H_
#define COMMPROTOCOL_COMMANDS_H_

/********************************************************************************/
/* Protocol Commands Definition                                                 */
/********************************************************************************/
#define MSP_GET_IDENT_INFORMATION   100   /* out message > quad type + firmware version + protocol version + capability variable */
#define MSP_GET_STATUS              101   /* out message > cycletime & errors_count & sensor present & box activation & current setting number */
#define MSP_GET_RAW_IMU             102   /* out message > 9 DOF */
#define MSP_GET_SERVO_DATA          103   /* out message > 8 servos */
#define MSP_GET_MOTOR_DATA          104   /* out message > 8 motors */
#define MSP_GET_RC_DATA             105   /* out message > 8 rc chan and more */
#define MSP_GET_RAW_GPS_DATA        106   /* out message > fix, numsat, lat, lon, alt, speed, ground course */
#define MSP_GET_COMP_GPS_DATA       107   /* out message > distance home, direction home */
#define MSP_GET_ATTITUDE            108   /* out message > 2 angles 1 heading */
#define MSP_GET_ALTITUDE            109   /* out message > altitude, variometer */
#define MSP_GET_ANALOG_DATA         110   /* out message > vbat, powermetersum, rssi if available on RX */
#define MSP_GET_RC_TUNING           111   /* out message > rc rate, rc expo, rollpitch rate, yaw rate, dyn throttle PID */
#define MSP_GET_PID_SETTINGS        112   /* out message > P I D coeff (9 are used currently) */
#define MSP_GET_BOX_CONFIG          113   /* out message > BOX setup (number is dependent of your setup) */
#define MSP_GET_MISC_DATA           114   /* out message > powermeter trig */
#define MSP_GET_MOTOR_PINS_CONFIG   115   /* out message > which pins are in use for motors & servos, for GUI */
#define MSP_GET_BOX_ITEM_NAMES      116   /* out message > the aux switch names */
#define MSP_GET_PID_NAMES           117   /* out message > the PID names */
#define MSP_GET_WAYPOINTS_DATA      118   /* out message > get a WP, WP# is in the payload, returns (WP#, lat, lon, alt, flags) WP#0-home, WP#16-poshold */
#define MSP_GET_BOX_IDS             119   /* out message > get the permanent IDs associated to BOXes */
#define MSP_GET_SERVO_CONFIG        120   /* out message > Servo settings */
#define MSP_GET_GPS_NAV_STATUS      121   /* out message > Returns navigation status */
#define MSP_GET_GPS_CONFIG          122   /* out message > Returns navigation parameters */

#define MSP_SET_RAW_RC_DATA         200   /* in message < 8 rc chan */
#define MSP_SET_RAW_GPS_DATA        201   /* in message < fix, numsat, lat, lon, alt, speed */
#define MSP_SET_PID_SETTINGS        202   /* in message < P I D coeff (9 are used currently) */
#define MSP_SET_BOX_CONFIG          203   /* in message < BOX setup (number is dependant of your setup) */
#define MSP_SET_RC_TUNING           204   /* in message < rc rate, rc expo, rollpitch rate, yaw rate, dyn throttle PID */
#define MSP_ACC_CALIBRATION         205   /* in message < no param */
#define MSP_MAG_CALIBRATION         206   /* in message < no param */
#define MSP_SET_MISC_DATA           207   /* in message < powermeter trig + 8 free for future use */
#define MSP_RESET_SYS_CONFIG        208   /* in message < no param */
#define MSP_SET_WAYPOINTS           209   /* in message < sets a given WP (WP#,lat, lon, alt, flags) */
#define MSP_SELECT_SETTING_NUM      210   /* in message < Select Setting Number (0-2) */
#define MSP_SET_HEADING             211   /* in message < define a new heading hold direction */
#define MSP_SET_SERVO_CONFIG        212   /* in message < Servo settings */
#define MSP_SET_MOTOR_DATA          214   /* in message < PropBalance function */
#define MSP_SET_GPS_CONFIG          215   /* in message < Sets nav config parameters and writes to the eeprom */

#define MSP_BIND_CMD                240   /* in message < no param */

#define MSP_EEPROM_WRITE_CMD        250   /* in message < no param */

#define MSP_GET_DEBUGMSG            253   /* out message > debug string buffer */
#define MSP_GET_DEBUG_DATA          254   /* out message > debug1,debug2,debug3,debug4 */

/********************************************************************************/
/* Exported Functions Prototypes                                                */
/********************************************************************************/
/* In message commands */
void CommProtocol_GetIdentInfoCMD(void);
void CommProtocol_GetStatusCMD(void);
void CommProtocol_GetIMURawDataCMD(void);
void CommProtocol_GetServoDataCMD(void);
void CommProtocol_GetMotorDataCMD(void);
void CommProtocol_GetRCRawDataCMD(void);
void CommProtocol_GetGPSRawDataCMD(void);
void CommProtocol_GetGPSComputedDataCMD(void);
void CommProtocol_GetAttitudeCMD(void);
void CommProtocol_GetAltitudeCMD(void);
void CommProtocol_GetAnalogData(void);
void CommProtocol_GetRCTuningCMD(void);
void CommProtocol_GetPIDSettingsCMD(void);
void CommProtocol_GetBoxConfigCMD(void);
void CommProtocol_GetMiscDataCMD(void);
void CommProtocol_GetMotorPinsConfigCMD(void);
void CommProtocol_GetBoxItemNamesCMD(void);
void CommProtocol_GetPIDNames(void);
void CommProtocol_GetWaypointsDataCMD(void);
void CommProtocol_GetBoxIdsCMD(void);
void CommProtocol_GetServoConfigCMD(void);
void CommProtocol_GetGPSNavStatusCMD(void);
void CommProtocol_GetGPSConfigCMD(void);

/* Out message commands */
void CommProtocol_SetRCRawDataCMD(void);
void CommProtocol_SetGPSRawDataCMD(void);
void CommProtocol_SetPIDSettingsCMD(void);
void CommProtocol_SetBoxConfigCMD(void);
void CommProtocol_SetRCTuningCMD(void);
void CommProtocol_RequestAccCalibrationCMD(void);
void CommProtocol_RequestMagCalibrationCMD(void);
void CommProtocol_SetMiscDataCMD(void);
void CommProtocol_ResetSystemConfigCMD(void);
void CommProtocol_SetWaypointsCMD(void);
void CommProtocol_SelectSettingsSetCMD(void);
void CommProtocol_SetHeadingCMD(void);
void CommProtocol_SetServoConfigCMD(void);
void CommProtocol_SetMotorDataCMD(void);
void CommProtocol_SetGPSConfigCMD(void);
void CommProtocol_BindCMD(void);
void CommProtocol_EEPROMWriteCMD(void);

/* Debug commands */
void CommProtocol_GetDebugMessageCMD(void);
void CommProtocol_GetDebugDataCMD(void);
#endif /* COMMPROTOCOL_COMMANDS_H_ */
